import request from '@/utils/http'
import qs from 'qs'

export function getEquipStatusNum (params) {
  return request({
    url: '/managementPlatform/getEquipStatusNum',
    method: 'GET',
    params
  })
}

export function getEquipAlarm (params) {
  return request({
    url: '/managementPlatform/getEquipAlarm',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params
  })
}
export function deviceFault (params) {
  return request({
    url: '/managementPlatform/deviceFault',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}

export function areaDict (params) {
  return request({
    url: '/commonDataInfo/areaDict',
    method: 'GET',
    params
  })
}

export function deviceDetails (data) {
  const params = qs.stringify(data)
  return request({
    url: '/comprehensive/deviceDetails',
    method: 'post',
    data: params
  })
}

export function screenData (data) {
  const params = qs.stringify(data)
  return request({
    url: '/comprehensive/screenData',
    method: 'POST',
    data: params
  })
}

export function areaCompany (data) {
  const params = qs.stringify(data)
  return request({
    url: '/comprehensive/areaCompany',
    method: 'POST',
    data: params
  })
}

export function screenCompanyData (params) {
  return request({
    url: '/comprehensive/screenCompanyData',
    method: 'GET',
    params
  })
}

export function companyDetails (params) {
  return request({
    url: '/comprehensive/companyDetails',
    method: 'POST',
    params
  })
}

export function deviceNumDetails (params) {
  return request({
    url: '/comprehensive/deviceNumDetails',
    method: 'POST',
    params
  })
}

export function getDustSensor (params) {
  return request({
    url: '/managementPlatform/getDustSensor',
    method: 'POST',
    data:params
  })
}

export function deviceFaultDetail (params) {
  return request({
    url: '/managementPlatform/deviceFaultDetail',
    method: 'POST',
    data:params
  })
}

// 登录接口
export function roleInfo (params) {
  return request({
    url: '/role/info',
    method: 'GET',
    params
  })
}

// 登录接口
export function areaDictByRole (params) {
  return request({
    url: '/commonDataInfo/areaDictByRole',
    method: 'GET',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}